package com.demo.core.model;

import java.util.Date;
import java.util.List;

import com.demo.core.model.support.SimpleBaseModel;
import com.demo.security.access.model.SecurityRole;

/**
 * 角色对象模型
 * 
 * @author ryuu.kk
 */
public class Role extends SimpleBaseModel implements SecurityRole, java.io.Serializable {

	/**
	 * 版本序列化ID
	 */
	private static final long serialVersionUID = 8367177148541057141L;
	
	/**站点自定义角色**/
	public static final String ROLE_TYPE_CUSTOM = "Custom";
	
	/**内建角色**/
	public static final String ROLE_TYPE_BUILTIN = "Builtin";
	
	/**
	 * 数据状态:可读
	 */
	public static final String ROLE_STATUS_R = "R";
	
	/**
	 * 数据状态:可写
	 */
	public static final String ROLE_STATUS_W = "W";
	
	/**
	 * 数据状态:可删
	 */
	public static final String ROLE_STATUS_D = "D";
	
	/**
	 * 数据状态:可读写
	 */
	public static final String ROLE_STATUS_RW = "RW";
	
	/**
	 * 数据状态:可读删
	 */
	public static final String ROLE_STATUS_RD = "RD";
	
	/**
	 * 数据状态:可读可写可删
	 */
	public static final String ROLE_STATUS_RWD = "RWD";
	
	/**
	 * 站点外键ID
	 */
	private Long siteId;
	/**
	 * 角色名
	 */
	private String name;
	/**
	 * 角色名称
	 */
	private String title;
	/**
	 * 角色有效期限
	 */
	private Date expireDay;
	/**
	 * 账号是否可用
	 */
	private boolean enabled;
	/**
	 * 角色类型
	 */
	private String type;
	/**
	 * 角色数据状态
	 */
	private String status;
	/**
	 * 角色描述
	 */
	private String description;
	/**
	 * 优先级
	 */
	private int priority;

	/**
	 * 功能列表
	 */
	private List<Function> functionList;
	
	public Long getSiteId() {
		return siteId;
	}
	public void setSiteId(Long siteId) {
		this.siteId = siteId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Date getExpireDay() {
		return expireDay;
	}
	public void setExpireDay(Date expireDay) {
		this.expireDay = expireDay;
	}
	public boolean isEnabled() {
		return enabled;
	}
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public int getPriority() {
		return priority;
	}
	public void setPriority(int priority) {
		this.priority = priority;
	}
	public List<Function> getFunctionList() {
		return functionList;
	}
	public void setFunctionList(List<Function> functionList) {
		this.functionList = functionList;
	}
	@Override
	public String getRoleName() {
		return this.name;
	}
	@Override
	public Boolean getEnabled() {
		return true;
	}
}
